<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>可漾官网-中式轻养饮品引领者</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta http-equiv="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta name="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="bookmark" href="favicon.ico" />
    <meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=0.5">
    <link rel="stylesheet" href="./static/css/main.css">
    <link rel="stylesheet" href="./static/css/header.min.css">
    <link rel="stylesheet" href="./static/css/index.min.css">
    <link rel="stylesheet" href="./static/css/footer.min.css">
    <link rel="stylesheet" href="./static/libs/swiper-bundle.min.css">
  </head>
  <body>
    <header>
    <div class="nav-box">
      <div id="logo" class="fl">
        <a href="./index.html"><img src="./static/images/Logo.png" alt="可漾"></a>
      </div>
      <ul class="nav fl clear">
        <a href="#" class="nav-item nav-item1 active">首页</a>
        <a href="./pages/about.html" class="nav-item">关于我们</a>  
        <span class="nav-item-wrap">
          <a href="./pages/product.html" class="nav-item">
            <span class="nav-span">可漾产品</span>
          </a>
          <ul class="nav-list nav-list-prod">
            <!-- <li class="nav-li">红豆薏米水</li>
            <li class="nav-li">绿豆水</li>
            <li class="nav-li">五红汤</li>
            <li class="nav-li">红豆水</li>
            <li class="nav-li">红豆牛蒡茶</li> -->
          </ul>
        </span>
        <span class="nav-item-wrap nav-item-wrap2">
          <a href="./pages/brandnew.html" class="nav-item">
            <span class="nav-span">企业动态</span>
          </a>
          <ul class="nav-list nav-list2 nav-list-dynamic">
            <li class="nav-li">
              <a href="./pages/brandnew.html">品牌新闻</a>
            </li>
            <li class="nav-li">
              <a href="./pages/enterpriseactivity.html">企业活动</a>
            </li>
            <li class="nav-li">
              <a href="./pages/wonderfulmoment.html">精彩瞬间</a>
            </li>
          </ul>
        </span>
        <a href="./pages/join.html" class="nav-item">加入我们</a>  
      </ul>
    </div>
  </header>
  <main>
    <!-- 轮播图 -->
    <div class="swiper">
        <div div class="swiper-wrapper">
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>
        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
    </div>
    <!-- 可漾产品 -->
    <dl class="product-box">
      <dt class="title-box">
        <h1>可漾产品</h1>
        <div class="prod-title-desc desc eq2" title=""></div>
        <div class="title-list-box">
        </div>
      </dt>
      <dd class="desc-img-box">
        <img src="" alt="">
      </dd>
    </dl>

    <!-- 企业动态 -->
    <dl class="company-dynamic flex">
      <dt class="dynamic-img-box pointer">
        <img src="" alt="">
        <div class="content-title"><span></span></div>
      </dt>
      <dd class="dynamic-list-box">
        <ul class="title-box flex">
          <h1>企业动态</h1>
          <p class="go-detail-more"><a href="./pages/brandnew.html">查看更多<i>&gt;&gt;</i></a></p>
        </ul>
        <div class="dynamic-desc desc word-hidden" title=""></div>
        <ul class="dynamic-list">
        </ul>
      </dd>
    </dl>
  </main>

  <!-- 底部区域 -->
  <footer>
    <div class="footer flex">
      <ul class="link-box flex">
        <li>
          <h3>关于我们</h3>
          <p><a href="./pages/about.html#about-box">企业介绍</a></p>
          <p><a href="./pages/about.html#mission-box">企业使命</a></p>
          <p><a href="./pages/about.html#roadmap">企业发展</a></p>
        </li>
        <li class="footer-prod-list">
        </li>
        <li>
          <h3>企业动态</h3>
          <p><a href="./pages/brandnew.html">品牌新闻</a></p>
          <p><a href="./pages/enterpriseactivity.html">企业活动</a></p>
          <p><a href="./pages/wonderfulmoment.html">精彩瞬间</a></p>
        </li>
        <li>
          <h3>加入我们</h3>
          <p><a href="./pages/join.html">未来展望</a></p>
          <p><a href="./pages/join.html">招商加盟</a></p>
        </li>
      </ul>
      <ul class="addr-box">
        <h2>怕湿气，喝可漾</h2>
        <p>山东可漾饮料有限公司</p>
        <p>售后服务热线：4006279199</p>
        <p>地址：山东省潍坊市坊子区黄旗堡街办一马路</p>
        <ul class="feedback flex-start">
          <li class="qr">
            <img src="./static/images/qrcode.png" alt="">
            <span>关注微信公众号</span>
            <img class="qrcode-scan" src="./static/images/qrcode-scan.png" alt="">
          </li>
        </ul>
      </ul>
    </div>
    <div class="right"><a href="https://beian.miit.gov.cn/#/Integrated/index">鲁ICP备19040840号-1</a></div>
  </footer>
  <div class="video-preview-box">
    <div class="mask">
      <p class="close"></p>
    </div>
    <video
      id="my-video"
      controls
      autoplay
      loop
      style="width: 100%;height: auto;object-fit: fill;"
    >
    </video>
  </div>
  </body>
  <script src="./static/js/master.js"></script>
  <script src="./static/libs/jquery-1.10.1.min.js"></script>
  <script src="./static/libs/swiper-bundle.min.js"></script>
  <script>
  var baseUrl = 'http://guanwang.keyangyinliao.com/api';
  $('.title-list-box .li').click(function() {
    $(this).addClass('active').siblings().removeClass('active');
  })

  // 轮播图
  var swiperData = [];
  var sliderDom = '';
  getSwiperData()
  function getSwiperData() {
    $.ajax({
      url: baseUrl + '/slide',
      type: 'get',
      dataType: 'json',
      success: function (res) {
        if (res.code !== 200) return;
        swiperData = res.data;
        initSwiperData()
      }
    })
  }
  function initSwiperData() {
    $.each(swiperData, function(i) {
      var sliderVideo = '';
      if (swiperData[i].video) {
        sliderVideo = '<li class="video-play" data-video="' + swiperData[i].video + '">' +
           (i === 0 ? '<span>开始播放</span>' : ' ' )  +
           (i === 0 ? '<img src="./static/images/video-start.png" alt="">' : ' ' )  +
          '</li>'
      }
      sliderDom += '<div class="swiper-slide">' +
        '<ul class="tip flex-column">' +
          '<li class="title">'+ (swiperData[i].title || '') +'</li>' +
          sliderVideo +
        '</ul>' +
        '<img class="swiper-banner" src="' + swiperData[i].img_url + '" alt="" srcset="">' +
      '</div>'
    })
    $('.swiper-wrapper').append(sliderDom);
    initSwiperEvent();
    initSliderVideoPlay();
  }
  function initSwiperEvent() {
    var mySwiper = new Swiper ('.swiper', {
      direction: 'horizontal', // 垂直切换选项
      loop: true, // 循环模式选项
      // autoplay: true,
      delay: 5000,
      speed: 1000,
      // 如果需要分页器
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
        bulletClass: 'swiper-my-pagination',
        bulletActiveClass: 'swiper-my-pagination-active',
      },
      // 如果需要前进后退按钮
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      }
    })
  }
  function initSliderVideoPlay() {
    $('.video-play').click(function() {
      $('.video-preview-box').show();
      $('#my-video').attr('src', $(this).attr("data-video"));
    })
    $('.close').click(function() {
      $('.video-preview-box').hide();
      $('#my-video').attr('src', '');
    })
    $('.mask').click(function() {
      $('.video-preview-box').hide();
      $('#my-video').attr('src', '');
    })
  }

  // 商品列表
  var prodListData = [];
  getProdList();
  function getProdList() {
    $.ajax({
      url: baseUrl + '/ad',
      type: 'get',
      dataType: 'json',
      success: function (res) {
        if (res.code !== 200) return;
        prodListData = res.data;
        initProdList()
      }
    })
  }
  function initProdList() {
    var prodListTitleHtml = '',
      prodListHeadSubHtml = '',
      footerProdListHtml = '<h3>可漾产品</h3>';
    $.each(prodListData, function(i) {

      // 内容里的产品列表
      var isActiveh1 = ''
      if (i == 0) {
        isActiveh1 = 'active'
      }
      var ind = '0' + String(i + 1);
      prodListTitleHtml += '<h2 class="li list-title ' + isActiveh1 + '"data-img="' + prodListData[i].large_img_url + '"data-desc="' + prodListData[i].desc + '">' + ind + '&nbsp' + prodListData[i].title + '</h2>'
    
      prodListHeadSubHtml += '<li class="nav-li" data-id=' + prodListData[i].id + '>' + prodListData[i].title + '</li>'
     
      footerProdListHtml += '<p><a href="./pages/product.html?id=' + prodListData[i].id + '">' + prodListData[i].title + '</a></p>';
    })
    
    $('.title-list-box').append(prodListTitleHtml);
    $('.desc-img-box img').attr('src', prodListData[0].large_img_url);

    $('.list-title').each(function() {
      $(this).click(function() {
        $(this).addClass('active').siblings('.list-title').removeClass('active');
        $('.desc-img-box img').attr({'src': $(this).attr('data-img'), title: $(this).attr('data-desc'), alt: $(this).attr('data-desc')});
      })
    })


    // 头部导航[产品]下的【子产品】导航
    $('.nav-list-prod').append(prodListHeadSubHtml);
    $('.nav-list-prod .nav-li').each(function(i) {
      $(this).click(function() {
        window.location.href = './pages/product.html?id=' + $(this).attr('data-id');
      })
    })

    // footer里的产品信息
    $('.footer-prod-list').append(footerProdListHtml);
  }
  
  // 动态列表
  var articleListData = [];
  getDynamicArticleList();
  function getDynamicArticleList() {
    $.ajax({
      url: baseUrl + '/article/listByCategoryName',
      type: 'get',
      dataType: 'json',
      data: {
        limit: 3,
        offset: 0
      },
      success: function (res) {
        if (res.code !== 200) return;
        articleListData = res.data && res.data.list;
        initDynamicArticleList();
      }
    })
  }

  // 动态新闻列表
  function initDynamicArticleList() {
    // 动态列表
    var articleListHtml = '';
    $.each(articleListData, function(i) {
      articleListHtml += '<li class="pointer li flex-column-center"' + " data-bannertitle=" + articleListData[i].title + 
      " data-bannerimg=" + articleListData[i].banner_img + " data-id=" + articleListData[i].id + " data-category=" + articleListData[i].article_categorie.name + '>' +
            '<h2>' + articleListData[i].title + '</h2>' +
            '<p class="time">' + articleListData[i].created_at + '</p>' +
            '<span class="more pointer">查看内容</span>' +
          '</li>'
    })

    $('.dynamic-list').append(articleListHtml);
    $('.dynamic-img-box').attr({ "data-id": articleListData[0].id });
    $('.dynamic-img-box').attr({ "data-category": articleListData[0].article_categorie.name });

    $('.dynamic-img-box img').attr({'src': articleListData[0].banner_img});
    $('.dynamic-img-box .content-title span').text(articleListData[0].title);
    $('.dynamic-list .li').each(function() {
      $(this).mouseover(function() {
        $('.dynamic-img-box img').attr('src', $(this).attr('data-bannerimg'));
        $('.dynamic-img-box .content-title span').text($(this).attr('data-bannertitle'));

        // 悬浮对应文章 左侧 图片跳转信息更新
        $('.dynamic-img-box').attr({ "data-id": $(this).attr('data-id'), "data-category": $(this).attr('data-category') });
      })
      $(this).click(function() {
        window.open('./pages/detail.html?' + 'id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category'), '_blank');
      })
    })

    // 点击企业动态左侧图片也跳进文章详情
    $('.dynamic-img-box').click(function() {
      window.open('./pages/detail.html?' + 'id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category'), '_blank');
    })
  }

  // 设置首页分类的描述信息
  getProdListToSetDesc('可漾产品');
  getProdListToSetDesc('品牌新闻');
  function getProdListToSetDesc(categoryName) {
    $.ajax({
      url: baseUrl + '/article/listByCategoryName',
      type: 'get',
      data: {
        category_name: categoryName,
        limit: 1,
        offset: 0
      },
      dataType: 'json',
      success: function (res) {
        if (res.code !== 200) return;
        var listData = res.data;
        if (categoryName == '可漾产品') {
          $('.prod-title-desc').text(listData.category_desc);
        } else if (categoryName == '品牌新闻') {
          $('.dynamic-desc').text(listData.category_desc);
        }
      }
    })
  }
</script>
</html>